# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-python-multipart
pkgver=0.0.14
pkgrel=0
pkgdesc="A streaming multipart parser for Python"
url="https://github.com/andrew-d/python-multipart"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="
	py3-gpep517
	py3-hatchling
	"
subpackages="$pkgname-doc $pkgname-pyc"
checkdepends="
	py3-pytest-runner
	py3-pytest-xdist
	py3-yaml
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/andrew-d/python-multipart/archive/$pkgver.tar.gz"
builddir="$srcdir/python-multipart-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python -m installer -d "$pkgdir" \
		.dist/python_multipart-*.whl

	install -vDm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}

sha512sums="
c53d3e8faec421dd05cd9c3695e80555ee9fdd65cf616fb65b4a948fa2ca86119e076d7b6b7aa1add386306774a5de1a03811b36eaf1cc36d6ab5310573ed0f3  py3-python-multipart-0.0.14.tar.gz
"
